<?php

/**
 * Project: Espolon
 * Licence: BSD License
 * Link: http://espolon.org/
 * Copyright: Nicolas de Bari Embriz Garcia Rojas <nbari at espolon dot org>
 * Author: Nicolas de Bari Embriz Garcia Rojas <nbari at espolon dot org>
 * Version: Beta
 */


/**
 *  LostPassword
 */
$user = new User();

if ($options[0] == 'code') {
  if (!empty($options[1]) AND $user->confirmCode($options[1],'lostpass')) {
    $tpl->assign('password', $user->getPassword());
    $tpl->assign('result', true); #activar usuario
    } else {
      $tpl->assign('msg',$user->getMsg());
      $tpl->assign('result', false); 
    }
} else {
  $form = new LostPassword($tpl, $user);
  // Try to validate a form
  if ($form->validate()) {
    $form->freeze();
    $form->process();
  } else {
    $form->displayForm();
  }
}

?>